<%@ page language="java" import="java.util.*, com.zjut.an.news.manager.*, com.zjut.an.news.dao.*, com.zjut.zs.applyview.manager.*, com.zjut.zs.applyview.dao.*, 
com.zjut.zs.user.manager.*, com.zjut.zs.user.dao.*,com.zjut.zs.userstatus.manager.*, com.zjut.zs.userstatus.dao.*,com.zjut.an.acquisitionhistory.dao.*,com.zjut.an.acquisitionhistory.manager.*,
com.zjut.an.webclass.manager.*, com.zjut.an.webclass.dao.*,com.zjut.an.util.tools.*,com.zjut.an.util.system.*,
com.zjut.an.config.manager.*, com.zjut.an.config.dao.*, com.zjut.zs.util.tools.*" pageEncoding="utf-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=Config.webname%></title>
	<link href="../plugins/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
	<link href="../plugins/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
	<link href="../plugins/assets/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
	<link href="../plugins/assets/css/style-metronic.css" rel="stylesheet" type="text/css"/>
	<link href="../plugins/assets/css/style.css" rel="stylesheet" type="text/css"/>
	<link href="../plugins/assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
	<link href="../plugins/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
	<link href="../plugins/assets/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color"/>
	<link href="../plugins/assets/css/custom.css" rel="stylesheet" type="text/css"/>
	<link rel="shortcut icon" href="favicon.ico" />
	
	<!-- 引入 ECharts 文件 -->
    <script src="../plugins/echarts/echarts.min.js"></script>
</head>
<%
AnAcquisitionHistoryManager acmanager = (AnAcquisitionHistoryManager) SpringContextUtil.getBean("AnAcquisitionHistoryManager");
AnConfigManager anconfig = (AnConfigManager) SpringContextUtil.getBean("AnConfigManager");
ZsUserManager umanager = (ZsUserManager) SpringContextUtil.getBean("ZsUserManager");
ZsUserStatusManager zsmanager = (ZsUserStatusManager) SpringContextUtil.getBean("ZsUserStatusManager");
ZsApplyViewManager manager = (ZsApplyViewManager) SpringContextUtil.getBean("ZsApplyViewManager");

if ("zkzh".equals(request.getParameter("action"))) {
	try {
		List list = acmanager.getDataByChannelUrl("准考证编号");
		acmanager.deleteDatas(list);
		
		ZsUserStatus obj = new ZsUserStatus();
		obj.setTestNo("0");
		list = zsmanager.getDataByInstance(1, 10000, null, null, obj).getObjects();
		for(int i=0; i<list.size(); i++) {
			obj = (ZsUserStatus)list.get(i);
			obj.setTestNo(null);
			zsmanager.updateData(obj);
		}		
		out.print("<script>alert('清空成功');</script>");
	} catch (Exception e) {
		e.printStackTrace();
		out.print("<script>alert('出错，请检查');</script>");
	}	
} else if("bmxh".equals(request.getParameter("action"))) {
	try {
		List list = acmanager.getDataByChannelUrl("报名序号编号");
		acmanager.deleteDatas(list);
		out.print("<script>alert('清空成功');</script>");
	} catch (Exception e) {
		e.printStackTrace();
		out.print("<script>alert('出错，请检查');</script>");
	}
}

 %>
<body class="page-header-fixed">
	<jsp:include page="systemrolevalidate.jsp" flush="true">
	<jsp:param name="m" value="systempower"/>
	</jsp:include>
	<div class="page-content">
		
		
			<div class="row">
				<div class="col-md-12">
					<ul class="page-breadcrumb breadcrumb">
					  <li>
						  <i class="fa fa-home"></i>
						  <a href="index.jsp">首页</a> 
						  <i class="fa fa-angle-right"></i>
						</li>
						<li><a href="#">清空准考证编号</a></li>
					</ul>
				</div>
			</div>
			<div class="row">
				<div class="col-md-12">
					<form id="ff1" Config="form" class="form-horizontal" action="zsUserTestNoClear.jsp" method="post">  
					<div class="formbody">   
						<ul class="forminfo">
							<li><label>清空准考证编号将清空所有考生的准考证编号，请谨慎操作。</label></li>
							<li>
							<input id="action" name="action" type="text" class="dfinput" value="zkzh"  style="display:none;"/>
							<button type="submit" class="btn btn-primary btn-sm">开始清空 </button>  
							</li>
						</ul>
					</div>
		            </form> 
				</div>
			</div>
			<div class="row">
				<div class="col-md-12">
					<form id="ff2" Config="form" class="form-horizontal" action="zsUserTestNoClear.jsp" method="post">  
					<div class="formbody">   
						<ul class="forminfo">
							<li><label>清空报名顺序号将使新注册人报名序号从1开始，请谨慎操作。</label></li>
							<li>
							<input id="action" name="action" type="text" class="dfinput" value="bmxh"  style="display:none;"/>
							<button type="submit" class="btn btn-primary btn-sm">开始清空 </button>  
							</li>
						</ul>
					</div>
		            </form> 
				</div>
			</div>
		</div>
	<script src="../plugins/assets/plugins/jquery-1.10.2.min.js" type="text/javascript"></script>
	<script src="../plugins/assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>    
	<script src="../plugins/assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
	<script src="../plugins/assets/plugins/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js" type="text/javascript" ></script>
	<script src="../plugins/assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
	<script src="../plugins/assets/plugins/jquery.blockui.min.js" type="text/javascript"></script>  
	<script src="../plugins/assets/plugins/jquery.cookie.min.js" type="text/javascript"></script>
	<script src="../plugins/assets/plugins/uniform/jquery.uniform.min.js" type="text/javascript" ></script>
	<script src="../plugins/assets/scripts/app.js"></script>  
	
	<script src="../plugins/assets/plugins/jquery-validation/dist/jquery.validate.js" type="text/javascript"></script>
	<script src="js/AnRoleForm.js" type="text/javascript" charset="utf-8"></script>  
	<script src="js/publicManager.js" type="text/javascript" charset="utf-8"></script>  
	
	<script>
	jQuery(document).ready(function() {       
		   App.init();
		});
	
		
	</script>
</body>
</html>